{% extends 'base.html' %}

{% block content%}
<form enctype="multipart/form-data" action="" method="post">{% csrf_token %}
<table class="tabl color1">
    <tr><td colspan="2" class="heador"><strong>Поиск сотрудников</strong></td></tr>
    <tr><td class="two"><strong>{{form.lastname.label}}:</strong></td><td class="one">{{form.lastname}}</td></tr>
    <tr><td class="two"><strong>{{form.name.label}}:</strong></td><td class="one">{{form.name}}</td></tr>
    <tr><td class="two"><strong>{{form.patronymic.label}}:</strong></td><td class="one">{{form.patronymic}}</td></tr>
    <tr><td class="two"><strong>{{form.unit.label}}:</strong></td><td class="one">{{form.unit}}</td></tr>
    <tr><td class="two"><strong>{{form.in_dismissed.label}}:</strong></td><td class="one">{{form.in_dismissed}}</td></tr>
    <tr><td class="two"><strong>{{form.in_repair.label}}:</strong></td><td class="one">{{form.in_repair}}</td></tr>
    <tr><td><input value="Искать" type="submit"></td><td></td></tr>
</table>
</form>
    {% if qs %}
        <table class="forma" width="100%" cellpadding="5" cellspacing="5" align="left">
            <tr class="heador">
                <td>ФИО</td>
                <td>Таб. Номер</td>
                <td>Подразделение</td>
            </tr>
    {% for item in qs %}
            <tr>
                <td>
                    {{ item.get_full_url|safe }}
                    {% if item.dismissed %}
                        <span style="color:red; font-size:15px;">*</span>
                    {% endif %}
                    {% if item.operative_repair %}
                        <span style="color:green; font-size:15px;">ᴥ</span>
                    {% endif %}
                </td>
                <td>{{ item.tabel_number }}</td>
                <td>{% if item.actual_unit %}<a href="{% url employee_list item.actual_unit.pk %}" title="{{ item.actual_unit.title }}">{{ item.actual_unit }}</a>{% endif %}</td>
            </tr>
    {% empty %}
        Не найдено сотрудников
    {% endfor %}
        </table>
        <div class="clear"></div>
        <table>
            {% if form.in_dismissed.value %}
            <tr>
                <td><span style="color:red; font-size:15px;">*</span> - звёздочкой отмечены сотрудники, которые были уволены.</td>
            </tr>
            {% endif %}
            <tr>
                <td><span style="color:green; font-size:15px;">ᴥ</span> - показывает его принадлежность к оперативному ремонту!</td>
            </tr>

        </table>
    {% endif %}
{% endblock %}